﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ItemList.ascx.cs" Inherits="简单三层架构.Controls.ItemList" %>
<asp:ListView runat="server" ID="lvwItems" GroupItemCount="3" 
    GroupPlaceholderID="groupPlaceholder" onitemcommand="lvwItems_ItemCommand">
    <LayoutTemplate>
        <table style="width: 100%; text-align: center; font-size: 12px;">
            <asp:PlaceHolder runat="server" ID="groupPlaceholder" />
        </table>
    </LayoutTemplate>
    <ItemTemplate>
        <td>
            <p>
                <asp:Image runat="server" ID="imgItem" ImageUrl='<%#"~/images/upload/" + Eval("Image")%>'/></p>
            <p>
                <asp:Label ID="lblTitle" runat="server" Text='<%#Eval("Title")%>' /></p>
            <p>
                <asp:Label  ID="lblPrice" CssClass="price" runat="server" Text='<%#"￥" + Eval("Price")%>'/></p>
            <p>
                <asp:Button runat="server" ID="btnBuy" Text="购买" CommandName="buy" CommandArgument='<%#Eval("ItemId")%>' />&nbsp;<asp:Button runat="server"
                                                                                     ID="btnFollow" Text="关注" />&nbsp;<asp:Button runat="server" ID="btnCompare" Text="对比" /></p>
        </td>
    </ItemTemplate>
    <GroupTemplate>
        <tr>
            <asp:PlaceHolder runat="server" ID="itemPlaceholder" />
        </tr>
    </GroupTemplate>
</asp:ListView>